<?php
namespace Admin\Form;

use Zend\Form\Element;

use Zend\Form\Form;
use Admin\Model\Util;

class SongForm extends Form {

	public function __construct($name = null) {
		parent::__construct('song');
		
		$this->add(array(
				'name' => 'id',
				'attributes' => array('type' => 'Hidden')
		));
		
		$this->add(array(
				'name' => 'title',
				'attributes' => array('type' => 'Text'),
				'options' => array('label' => 'Titre')
		));
		
		$this->add(array(
				'name' => 'abc',
				'attributes' => array('type' => 'Textarea', 'id' => 'abc'),
				'options' => array('label' => 'Abc')
		));
		
		$this->add(array(
				'name' => 'date_create',
				'attributes' => array(
						'type' => 'Text',
						'value' => Util::formateDate(),
						'class' => 'date'
				),
				'options' => array('label' => "Date d'ajout")
		));
		
		$this->add(array(
				'name' => 'date_update',
				'attributes' => array(
						'type' => 'Text', 
						'value' => Util::formateDate(),
						'class' => 'date'
				),
				'options' => array('label' => "Date de modification")
		));
		
		$state = new Element\Checkbox('state');
		$state->setLabel('Activé');
		$state->setCheckedVAlue('0');
		$state->setUncheckedValue('1');
		$this->add($state);

		$this->add(array(
				'name' => 'user_id',
				'attributes' => array('type' => 'hidden')
		));
		
		$this->add(array(
				'name' => 'submit',
				'attributes' => array(
						'type'  => 'submit',
						'value' => 'Enregistrer',
						'id' => 'submit',
						'class' => 'btn btn-primary',
				),
		));
		
		$this->add(array(
				'name' => 'submitquit',
				'attributes' => array(
						'type'  => 'submit',
						'value' => 'Enregistrer et Quitter',
						'id' => 'submitquit',
						'class' => 'btn',
				),
		));
		
		$this->add(array(
				'name' => 'render',
				'attributes' => array(
						'type'  => 'button',
						'value' => 'Apperçu',
						'id' => 'render',
						'class' => 'btn',
				),
		));
		
	}
	
}